/**
 * Project Name:
 * File Name:BaseException.java
 * Package Name:com.times.exception
 * Date:2015年7月3日下午2:00:19
 * Copyright (c) 2015, times.com All Rights Reserved.
 *
 */

package com.times.exception;

import com.times.cache.Cache;


/**
 * ClassName: BaseException <br/>
 * Function: 基本异常类，初始化基本返回类型
 *
 * @author ZZW
 * @version 2015年7月3日 
 */
public class BaseException extends RuntimeException {

    private static final long serialVersionUID = -3637172659954598718L;
    
    private Object code;
    
    /**
     * Creates a new instance of BaseException.
     *
     */
    public BaseException() {
        super();
    }
    
    public BaseException(Throwable cause, Object code, Object ... params){
        super(String.format(Cache.getProperty(code), params), cause);
        this.code = code;
    }
    
    public BaseException(Object code, Object ... params){
    	super(String.format(Cache.getProperty(code), params));
    	this.code = code;
    }

    /**
     * Creates a new instance of BaseException.
     *
     * @param message
     * @param cause
     * @param enableSuppression
     * @param writableStackTrace
     */
    public BaseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super();
    }

    /**
     * Creates a new instance of BaseException.
     *
     * @param message
     * @param cause
     */
    public BaseException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * Creates a new instance of BaseException.
     *
     * @param message
     */
    public BaseException(String message) {
        super(message);
    }

    /**
     * Creates a new instance of BaseException.
     *
     * @param cause
     */
    public BaseException(Throwable cause) {
        super(cause);
    }

    
    /**
     * Getter method for property <tt>code</tt>.
     *
     * @return property value of code.
     */
    public Object getCode() {
        return code;
    }

    
    /**
     * Setter method for property <tt>code</tt>.
     *
     * @param code value to be assigned to property code.
     */
    public void setCode(Object code) {
        this.code = code;
    }

}

